package com.ruoyi.healthcode.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.healthcode.mapper.HealthCodeMapper;
import com.ruoyi.healthcode.domain.HealthCode;
import com.ruoyi.healthcode.service.IHealthCodeService;

/**
 * 健康码查询Service业务层处理
 *
 * @author 刘焕然
 * @date 2022-12-09
 */
@Service
public class HealthCodeServiceImpl implements IHealthCodeService
{
    @Autowired
    private HealthCodeMapper healthCodeMapper;

    /**
     * 查询健康码查询
     *
     * @param id 健康码查询主键
     * @return 健康码查询
     */
    @Override
    public HealthCode selectHealthCodeById(Long id)
    {
        return healthCodeMapper.selectHealthCodeById(id);
    }

    /**
     * 查询健康码查询列表
     *
     * @param healthCode 健康码查询
     * @return 健康码查询
     */
    @Override
    public List<HealthCode> selectHealthCodeList(HealthCode healthCode)
    {
        return healthCodeMapper.selectHealthCodeList(healthCode);
    }

    /**
     * 新增健康码查询
     *
     * @param healthCode 健康码查询
     * @return 结果
     */
    @Override
    public int insertHealthCode(HealthCode healthCode)
    {
        healthCode.setCreateTime(DateUtils.getNowDate());
        return healthCodeMapper.insertHealthCode(healthCode);
    }

    /**
     * 修改健康码查询
     *
     * @param healthCode 健康码查询
     * @return 结果
     */
    @Override
    public int updateHealthCode(HealthCode healthCode)
    {
        healthCode.setUpdateTime(DateUtils.getNowDate());
        return healthCodeMapper.updateHealthCode(healthCode);
    }

    /**
     * 批量删除健康码查询
     *
     * @param ids 需要删除的健康码查询主键
     * @return 结果
     */
    @Override
    public int deleteHealthCodeByIds(Long[] ids)
    {
        return healthCodeMapper.deleteHealthCodeByIds(ids);
    }

    /**
     * 删除健康码查询信息
     *
     * @param id 健康码查询主键
     * @return 结果
     */
    @Override
    public int deleteHealthCodeById(Long id)
    {
        return healthCodeMapper.deleteHealthCodeById(id);
    }

    @Override
    public int deleteHealthCodeByIdCards(String[] idCards) {
        return healthCodeMapper.deleteHealthCodeByIdCards(idCards);
    }
}
